﻿@{
    ViewBag.Title = "Search";
    ViewBag.SearchActive = "active";
}
<div class="container-fluid">
    <div class="row-fluid">
        <div class="span12 well">
            <form class="form-horizontal" method="POST" action="~/Search/SelectCategory">
                <label class="control-label" for="category">Filter by Category: </label>
                <select name="category" id="category">
                    <option selected="selected">Category</option>
                    @foreach(var category in Model.categoryList)
                    {
                       
                        <option value="@category.Name">@category.Name</option>
                    }
                </select>
                <input type="submit" class="btn btn-primary" value="Submit" />
            </form>
            <table id="category_table" class="table table-striped table-bordered">
                <thead>
                    <tr>
                        <td>Name</td>
                        <td>Price</td>
                        <td>Description</td>
                        <td>Ending Time</td>
                    </tr>
                </thead>
                @foreach (var item in Model.itemList)
                {
                    <tr>
                        <td><a href="~/ItemDetail/Detail?itemId=@item.Id">@item.Name</a></td>
                        <td>@String.Format("{0:C}", item.Price)</td>
                        <td>@item.Description</td>
                        <td>@item.EndTime</td>
                    </tr>
                }
            </table>
        </div>
    </div>
</div>
<script type="text/javascript">
    $(document).ready(function () {
        $('#category_table').dataTable();
    });
</script>